package com.edu.buservice.dal.config;

import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @program: KQAIA
 * @description:
 * @author: 无恙
 * @create: 2025-03-09 14:41
 **/

// java example
//@Slf4j
//@Component
//public class MyMetaObjectHandler implements MetaObjectHandler {
//
//	@Override
//	public void insertFill(MetaObject metaObject) {
//		log.info("开始插入填充...");
//		this.strictInsertFill(metaObject, "createdAt", Date.class, new Date());
//		this.strictInsertFill(metaObject, "updatedAt", Date.class, new Date());
//	}
//
//	@Override
//	public void updateFill(MetaObject metaObject) {
//		log.info("开始更新填充...");
//		this.strictInsertFill(metaObject, "updatedBy",String.class, StpUtil.getLoginIdAsString());
//		this.strictInsertFill(metaObject, "updatedAt",Date.class, new Date());
//	}
//}
